/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.client.view.base;

import com.smartgwt.client.widgets.BaseWidget;
import com.smartgwt.client.widgets.layout.Layout;

/**
 * @author aeky
 */
public class AekyWidget extends Layout {

    /** The token. */
    private String token;

    public AekyWidget() {
        this.setToken(this.getClassToken());
    }

    /**
     * Gets the class token.
     * 
     * @return the class token
     */
    protected String getClassToken() {
        return getClassToken(getClass());
    }

    /**
     * Gets the class token.
     * 
     * @param classType the class type
     * 
     * @return the class token
     */
    protected String getClassToken(Class<? extends BaseWidget> classType) {
        String className = classType.getName();
        className = className.substring(className.lastIndexOf('.') + 1);
        return className;
    }

    /**
     * @return the token
     */
    public String getToken() {
        return token;
    }

    /**
     * @param token the token to set
     */
    public void setToken(String token) {
        this.token = token;
    }

}
